import './assets/main.css'
import './tailwind/index.css'

import { createApp, type Plugin } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

import 'animate.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
app.use(createPinia())
router.beforeEach((to: any, from: any, next: any) => {
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})
// console.log(import.meta.env.VITE_API_URL)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(ElementPlus as Plugin, { locale: zhCn })

app.use(router)

app.mount('#app')
